home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tex / inputs / jeep.sty (.txt) < prev    next >
LaTeX Document  |  1991-05-20  |  11KB  |  249 lines

  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. % jeep.sty, February  3, 1989
  3. % G. W. Stewart
  4. % Department of Computer Science
  5. % University of Maryland
  6. % College Park, MD 20784
  7. % stewart@thales.umd.edu
  8. % This is a personal customization of the LaTeX style files
  9. % article (4/16/88) and report (5/26/88).  The changes are
  10. % described more fully in the document jeep.tex.  Briefly
  11. % the style
  12. %    1. Changes the default page sizes to reflect the fact
  13. %       that most output will be on 8.5 x 11 inch paper.
  14. %    2. Adds commands that allow the casual LaTeX to change
  15. %       the formats of chapter, section, and theorem heads.
  16. %    3. Adds commands to number equations and theorems within
  17. %       sections or subsections.
  18. %    4. Makes Lance Berc's three part headers and footers the
  19. %       default page style.  Adds a macro to underline the
  20. %       header.
  21. %    5. Changes the default numbering of enumerate to arabic.
  22. %       Adds a new enumeration environment in which the items
  23. %       are close together.
  24. %    6. Adds a command to produce a compact table of contents.
  25. %    7. Adds commands to produce symbolic footnote marks and
  26. %       equation labels.
  27. % Change the default page sizes.
  28. \setlength{\topmargin}{.25in}
  29. \setlength{\textheight}{7.5in}
  30. \setlength{\oddsidemargin}{.375in}
  31. \setlength{\evensidemargin}{.375in}
  32. \setlength{\textwidth}{5.75in}
  33. % Define the command \mychapter{<head1>}{<head2>}.  <head1>
  34. % is the text to put in the chapter head if there is a
  35. % chapter number; <head2>, if not.
  36. \def\@chapapp{Chapter}
  37. \def\chapapp{\@chapapp}
  38. \def\mychapter#1#2{
  39.    \def\@chaphead##1{#1}
  40.    \def\@schaphead##1{#2}
  41. \def\@makechapterhead#1{ \vspace*{\chaptopsep} { \parindent 0pt \raggedright
  42.  \ifnum \c@secnumdepth >\m@ne \@chaphead{#1} \else \@schaphead{#1} \fi
  43.  \par \nobreak \vskip \chapaftersep } }
  44. \def\@makeschapterhead#1{ \vspace*{\chaptopsep} { \parindent 0pt \raggedright
  45.  \@schaphead{#1}\par
  46.  \nobreak \vskip \chapaftersep } }
  47. % \chaptopsep is the space between the top of the text page and the
  48. % chapter head.  \chapaftersep is the space between the chapter
  49. % head and the text.
  50. \newlength{\chaptopsep}
  51. \setlength{\chaptopsep}{.5in}
  52. \newlength{\chapaftersep}
  53. \setlength{\chapaftersep}{.5in}
  54. % Default chapter headings.
  55. \mychapter{\LARGE \sc \thechapter. #1}{\LARGE \sc #1}
  56. % Define the command \mysection{<sec>}{<style>}{<prefix>}.
  57. % <sec> is the section level--section, subsection, etc.  <style>
  58. % is the style in which the section head is to be set; e.g.,
  59. % \large\bf.  <prefix> is what proceeds the head text, usually
  60. % \the<sec> followed by some putctuation.
  61. \def\@startsection#1#2#3#4#5#6{\if@noskipsec \leavevmode \fi
  62.    \par \@tempskipa #4\relax
  63.    \@afterindenttrue
  64.    \ifdim \@tempskipa <\z@ \@tempskipa -\@tempskipa \@afterindentfalse\fi
  65.    \if@nobreak \everypar{}\else
  66.      \addpenalty{\@secpenalty}\addvspace{\@tempskipa}\fi \@ifstar
  67.      {\@ssect{#3}{#4}{#5}{#1}}{\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
  68. \def\@sect#1#2#3#4#5#6[#7]#8{\ifnum #2>\c@secnumdepth
  69.      \def\@svsec{}\else 
  70.      \refstepcounter{#1}
  71.      \edef\@svsec{\expandafter\relax\csname @pre#1\endcsname}\fi
  72.      \@tempskipa #5\relax
  73.       \ifdim \@tempskipa>\z@ 
  74.         \begingroup \expandafter\relax\csname @#1style\endcsname\relax
  75.           \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty \@M #8\par}
  76.         \endgroup
  77.        \csname #1mark\endcsname{#7}\addcontentsline
  78.          {toc}{#1}{\ifnum #2>\c@secnumdepth \else
  79.                       \protect\numberline{\csname the#1\endcsname}\fi
  80.                     #7}\else
  81.         \def\@svsechd{
  82.             \expandafter\relax\csname @#1style\endcsname\relax
  83.             \hskip #3\@svsec #8\csname #1mark\endcsname
  84.                       {#7}\addcontentsline
  85.                            {toc}{#1}{\ifnum #2>\c@secnumdepth \else
  86.                              \protect\numberline{\csname the#1\endcsname}\fi
  87.                        #7}}\fi
  88.      \@xsect{#5}}
  89. \def\@ssect#1#2#3#4#5{\@tempskipa #3\relax
  90.    \ifdim \@tempskipa>\z@
  91.      \begingroup \expandafter\relax\csname @#4style\endcsname\relax
  92.      \@hangfrom{\hskip #1}{\interlinepenalty \@M #5\par}\endgroup
  93.    \else \def\@svsechd{#4\hskip #1\relax #5}\fi
  94.     \@xsect{#3}}
  95. \def\mysection#1#2#3{
  96.      \expandafter\def\csname @#1style\endcsname{#2}
  97.      \expandafter\def\csname @pre#1\endcsname{#3}
  98. % Default section heads.
  99. \mysection{section}{\large\bf}{\thesection.~}
  100. \mysection{subsection}{\normalsize\bf}{\thesubsection.~}
  101. \mysection{subsubsection}{\normalsize\bf}{\thesubsubsection.~}
  102. \mysection{paragraph}{\normalsize\bf}{\theparagraph.}
  103. \mysection{subparagraph}{\normalsize\bf}{\thesubparagraph.}
  104. % Redefine theorem environment macros to put \theoremcounterend
  105. % (default ".") after the "theorem" head.
  106. \def\@begintheorem#1#2{\sl \trivlist
  107.    \item[\hskip \labelsep{\bf #1\ #2\thmcounterend}]}
  108. \def\@opargbegintheorem#1#2#3{\sl \trivlist
  109.       \item[\hskip \labelsep{\bf #1\ #2\ (#3)\thmcounterend}]}
  110. \def\thmcounterend{.}
  111. % Define \numberbysection to number figures, table, equations, and
  112. % theorems within sections.  Similarly for \numberbysubsection.  Any
  113. % theorem-like environment numbered with theorem inherits this
  114. % numbering (however, be sure to define the.  theorem environment
  115. % before invoking \numberbysection or \numberbysubsection).
  116. \def\numberbysection{\renewcommand{\thesection}{\arabic{section}}
  117.                      \renewcommand{\theequation}{\thesection.\arabic{equation}}
  118.                      \@addtoreset{equation}{section}
  119.                      \renewcommand{\thetheorem}{\thesection.\arabic{theorem}}
  120.                      \@addtoreset{theorem}{section}
  121.                      \renewcommand{\thefigure}{\thesection.\arabic{figure}}
  122.                      \@addtoreset{figure}{section}
  123.                      \renewcommand{\thetable}{\thesection.\arabic{table}}
  124.                      \@addtoreset{table}{section}}
  125. \def\numberbysubsection{\renewcommand{\thesection}{\arabic{section}}
  126.               \renewcommand{\thesubsection}{\arabic{subsection}}
  127.               \renewcommand{\theequation}{\thesubsection.\arabic{equation}}
  128.               \@addtoreset{equation}{subsection}
  129.               \renewcommand{\thetheorem}{\thesubsection.\arabic{theorem}}
  130.               \@addtoreset{theorem}{subsection}
  131.               \renewcommand{\thefigure}{\thesubsection.\arabic{figure}}
  132.               \@addtoreset{figure}{subsection}
  133.               \renewcommand{\thetable}{\thesubsection.\arabic{table}}
  134.               \@addtoreset{table}{subsection}}
  135. \@definecounter{theorem}
  136. % Change the labels of enumerate and outline to arabic numbers.
  137. \def\labelenumi{\arabic{enumi}.} 
  138. \def\theenumi{\arabic{enumi}} 
  139. \def\labelenumii{\arabic{enumii}.}
  140. \def\theenumii{\arabic{enumii}}
  141. \def\p@enumii{\theenumi.}
  142. \def\labelenumiii{\arabic{enumiii}.}
  143. \def\theenumiii{\arabic{enumiii}}
  144. \def\p@enumiii{\theenumi.\theenumii.}
  145. \def\labelenumiv{\arabic{enumiv}.}
  146. \def\theenumiv{\arabic{enumiv}} 
  147. \def\p@enumiv{\p@enumiii.\theenumiii}
  148. % Outline is a new list style--the same as enumerate with
  149. % less space between the items.
  150. \def\outline{\ifnum \@enumdepth >3 \@toodeep\else
  151.       \advance\@enumdepth \@ne 
  152.       \edef\@enumctr{enum\romannumeral\the\@enumdepth}\list
  153.       {\csname label\@enumctr\endcsname}{\usecounter
  154.         {\@enumctr}\def\makelabel##1{\hss\llap{##1}}
  155.          \parsep \z@ \itemsep \z@ 
  156.          \ifnum \@enumdepth > 1 \topsep \z@ \fi}\fi}
  157. \let\endoutline =\endlist
  158. % Three part head and foot macros by
  159. % Lance Berc
  160. % Olivetti Research Center
  161. % 2882 Sand Hill Road
  162. % Menlo Park, California 94025
  163. % (415) 496-6200
  164. % lance@orc.olivetti.com
  165. \def\lhead#1{\gdef\@lhead{#1}} \def\lfoot#1{\gdef\@lfoot{#1}}
  166. \def\chead#1{\gdef\@chead{#1}} \def\cfoot#1{\gdef\@cfoot{#1}}
  167. \def\rhead#1{\gdef\@rhead{#1}} \def\rfoot#1{\gdef\@rfoot{#1}}
  168. \def\@lhead{} \def\@lfoot{}
  169. \def\@chead{} \def\@cfoot{}
  170. \def\@rhead{} \def\@rfoot{}
  171. \def\@threepart#1#2#3{\rlap{#1} \hfil {#2} \hfil \llap{#3}}
  172. \def\ps@threepartheadings
  173.     {
  174.     \def\@oddhead{\@threepart{\@lhead}{\@chead}{\@rhead}}
  175.     \def\@oddfoot{\@threepart{\@lfoot}{\@cfoot}{\@rfoot}}
  176.     \if@twoside
  177.     \def\@evenhead{\@threepart{\@rhead}{\@chead}{\@lhead}}
  178.     \def\@evenfoot{\@threepart{\@rfoot}{\@cfoot}{\@lfoot}}
  179.     \else
  180.     \def\@evenhead{\@threepart{\@lhead}{\@chead}{\@rhead}}
  181.     \def\@evenfoot{\@threepart{\@lfoot}{\@cfoot}{\@rfoot}}
  182.     \fi
  183.     }
  184. \ps@threepartheadings
  185. % Define \underhead to put a rule under the headers.  \nounderhead
  186. % suppresses \underhead on the current page.  The space between
  187. % the text and the rule is \underheadsep.
  188. \def\underhead{
  189.  \addtolength{\headheight}{\underheadsep}
  190.  \def\@outputpage{\begingroup\catcode`\ =10 \if@specialpage 
  191.      \global\@specialpagefalse\@nameuse{ps@\@specialstyle}\fi
  192.      \if@twoside 
  193.        \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
  194.             \let\@themargin\oddsidemargin
  195.           \else \let\@thehead\@evenhead
  196.           \let\@thefoot\@evenfoot \let\@themargin\evensidemargin
  197.      \fi\fi
  198.      \shipout
  199.      \vbox{\normalsize \baselineskip\z@ \lineskip\z@
  200.            \vskip \topmargin \moveright\@themargin
  201.            \vbox{\setbox\@tempboxa
  202.                    \vbox to\headheight{\vfil \hbox to\textwidth{\@thehead}
  203.                          \vskip \underheadsep
  204.                           \if@nounderhead\global\@nounderheadfalse
  205.                                  \hbox to\textwidth{}
  206.                           \else  \hbox to\textwidth{\hrulefill}\fi}
  207.                  \dp\@tempboxa\z@
  208.                  \box\@tempboxa
  209.                  \vskip \headsep
  210.                  \box\@outputbox
  211.                  \baselineskip\footskip
  212.                  \hbox to\textwidth{\@thefoot}}}\global\@colht\textheight
  213.            \endgroup\stepcounter{page}\let\firstmark\botmark}
  214. \def\ps@empty{\@nounderheadtrue
  215.               \let\@mkboth\@gobbletwo\def\@oddhead{}\def\@oddfoot{}%
  216. \def\@evenhead{}\def\@evenfoot{}}
  217. \def\ps@plain{\@nounderheadtrue
  218.      \let\@mkboth\@gobbletwo
  219.      \def\@oddhead{}\def\@oddfoot{\rm\hfil\thepage
  220.      \hfil}\def\@evenhead{}\let\@evenfoot\@oddfoot}
  221. \newif\if@nounderhead \@nounderheadfalse
  222. \def\nounderhead{\@nounderheadtrue}
  223. \newlength{\underheadsep}
  224. \setlength{\underheadsep}{.5ex}
  225. % Define \tighttoc to alter table of contents entry so that
  226. % sections are treated like subsections, subsubsections, etc.
  227. \def\tighttoc{\def\l@section{\@dottedtocline{1}{0em}{1.4em}}}
  228. % Define \symbolnote{<num>}{<text>} to produce a note with footnote
  229. % mark <num> (less than 10).  The commands \symbolmark{<num>}
  230. % and \symboltext{<num>}{<text>} are analogues of
  231. % \footnotemark[<num>] and \footnotetext[<num>]{<text>}.
  232. \def\symbolnote#1#2{\let\@thefootn=\thefootnote%
  233. \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
  234. \footnotemark[#1]%
  235. \footnotetext[#1]{#2}%
  236. \let\thefootnote=\@thefootn
  237. \def\symbolmark#1{\let\@thefootn=\thefootnote%
  238. \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
  239. \footnotemark[#1]%
  240. \let\thefootnote=\@thefootn
  241. \def\symboltext#1#2{\let\@thefootn=\thefootnote%
  242. \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
  243. \footnotetext[#1]{#2}%
  244. \let\thefootnote=\@thefootn
  245. % Define symboleqn environment to make a displayed equation with
  246. % a symbolic equation label.
  247. \newenvironment{symboleqn}[1]{
  248.    \def\@savesymbol{#1}$$}{\eqno \@savesymbol $$\global\@ignoretrue}
  249.